<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>修改商品</title>

		<meta name="description" content="Minimal empty page" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<!--basic styles-->

		<link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet" />
		<link href="__PUBLIC__/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__PUBLIC__/css/font-awesome.min.css" />
		<link rel="stylesheet" href="__PUBLIC__/kindeditor/themes/default/default.css" />
		<script charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor-min.js"></script>
		<script charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh_CN.js"></script>

		<script type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>
		<!--自定义样式-->
		<link rel="stylesheet" href="__PUBLIC__/css/custom.css" />

		<!--[if IE 7]>
		  <link rel="stylesheet" href="__PUBLIC__/css/font-awesome-ie7.min.css" />
		<![endif]-->

		<!--page specific plugin styles-->

		<!--bbc styles-->

		<link rel="stylesheet" href="__PUBLIC__/css/bbc.min.css" />
		<link rel="stylesheet" href="__PUBLIC__/css/bbc-responsive.min.css" />
		<link rel="stylesheet" href="__PUBLIC__/css/bbc-skins.min.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="__PUBLIC__/css/bbc-ie.min.css" />
		<![endif]-->
	</head>

	<body>
		<!--导航-->
		<include file="Public:navbar" />

		<div class="container-fluid" id="main-container">
			<a id="menu-toggler" href="#">
				<span></span>
			</a>
			<!--边栏-->
			<include file="Public:sidebar" />


			<div id="main-content" class="clearfix">
				<div id="breadcrumbs">
					<ul class="breadcrumb">
						<li>
							<i class="icon-home"></i>
							<a href="#">Home</a>

							<span class="divider">
								<i class="icon-angle-right"></i>
							</span>
						</li>

						<li>
							<a href="#">矿机管理</a>

							<span class="divider">
								<i class="icon-angle-right"></i>
							</span>
						</li>
					</ul><!--.breadcrumb-->
				</div>

				<div id="page-content" class="clearfix">
					<div class="page-header position-relative">
						<h1>
							修改矿机
						</h1>
					</div><!--/.page-header-->

					<div class="row-fluid">
						<!--PAGE CONTENT BEGINS HERE-->
							<form class="form-horizontal" name="editProductHandle"  enctype="multipart/form-data" action="{:U(GROUP_NAME .'/Shop/editProductHandle')}" method="post">
							<input type="hidden"  name="id" value="{$product.id}">
								<div class="control-group">
									<label class="control-label" for="title"> 矿机名称</label>
                                   
									<div class="controls">
										<input type="text" value="{$product.title}" name="title" id="title" placeholder="" />
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="tid"> 分类</label>

									<div class="controls">
									   <select name="tid">
									     <option value="-1">请选择分类</option>	   
											<foreach name="types" item="type">
												<if condition='$product["tid"] eq $type["id"]'>
													<option value="{$type.id}" selected>{$type.name}</option>
												<else/>
													<option value="{$type.id}">{$type.name}</option>
												</if>
													
											</foreach>
										</select>
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="price"> 单价</label>

									<div class="controls">
										<input type="text" value="{$product.price}" name="price" id="price" placeholder="" />
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="stock"> 库存</label>

									<div class="controls">
										<input type="text" value="{$product.stock}" name="stock" id="stock" placeholder="" />
									</div>
								</div>		

								<div class="control-group">
									<label class="control-label" for="gonglv"> 算力</label>

									<div class="controls">
										<input type="text" value="{$product.gonglv}" name="gonglv" id="gonglv" placeholder="" />
									</div>
								</div>	
								<div class="control-group">
									<label class="control-label" for="yszq"> 运行周期</label>

									<div class="controls">
										<input type="text" value="{$product.yszq}" name="yszq" id="yszq" placeholder="" />
									</div>
								</div>	
								<div class="control-group">
									<label class="control-label" for="shouyi"> 收益</label>

									<div class="controls">
										<input type="text" value="{$product.shouyi}" name="shouyi" id="shouyi" placeholder="" /> /每小时
									</div>
								</div>
                                
                                
                                 <div class="control-group">
									<label class="control-label" for="xiangou"> 限购</label>

									<div class="controls">
										<input type="text" value="{$product.xiangou}" name="xiangou" id="xiangou" placeholder="" />
									</div>
								</div>	
                                
                                 <div class="control-group">
									<label class="control-label" for="xianshou"> 限制出售数量</label>

									<div class="controls">
										<input type="text" value="{$product.xianshou}" name="xianshou" id="xianshou" placeholder="" />
									</div>
								</div>	
                                
                                 <div class="control-group">
									<label class="control-label" for="is_on"> 上下架</label>

									<div class="controls">
										
                                        
                                          <select name="is_on">
                                            <option value="0" <if condition="$product['is_on'] eq 0 "> selected="selected"</if>>上架</option>
                                            <option value="1" <if condition="$product['is_on'] eq 1 "> selected="selected"</if>>下架</option>
                                         </select>
                                        
                                        
                                        
									</div>
								</div>	
                                
                                
                                
                                	
								<div class="control-group">
									<label class="control-label" for="price"> 缩略图</label>

									<div class="controls">
										 <input type="file" name="thumb"> 缩略图大小：300*250 
									</div>
								</div>
								<div class="control-group">
									<label class="control-label" for="content"> 商品详情</label>

									<div class="controls">
										<textarea name="content" id="content" style="width:700px; height:300px">{$product.content}</textarea>
									</div>
								</div>
              						
								<div class="form-actions">
									<button class="btn btn-info no-border" type="submit">
										<i class="icon-ok bigger-110"></i>
										保存添加
									</button>
								</div>

							</form>
						<!--PAGE CONTENT ENDS HERE-->
					</div><!--/row-->
				</div><!--/#page-content-->

				<div id="ace-settings-container">
					<div class="btn btn-app btn-mini btn-warning" id="ace-settings-btn">
						<i class="icon-cog"></i>
					</div>

					<div id="ace-settings-box">
						<div>
							<div class="pull-left">
								<select id="skin-colorpicker" class="hidden">
									<option data-class="default" value="#438EB9">#438EB9</option>
									<option data-class="skin-1" value="#222A2D">#222A2D</option>
									<option data-class="skin-2" value="#C6487E">#C6487E</option>
									<option data-class="skin-3" value="#D0D0D0">#D0D0D0</option>
								</select>
							</div>
							<span>&nbsp; 选择样式</span>
						</div>

						<div>
							<input type="checkbox" class="ace-checkbox-2" id="ace-settings-header" />
							<label class="lbl" for="ace-settings-header"> Fixed Header</label>
						</div>

						<div>
							<input type="checkbox" class="ace-checkbox-2" id="ace-settings-sidebar" />
							<label class="lbl" for="ace-settings-sidebar"> Fixed Sidebar</label>
						</div>
					</div>
				</div><!--/#ace-settings-container-->
			</div><!--/#main-content-->
		</div><!--/.fluid-container#main-container-->



		<script src="__PUBLIC__/js/jquery-1.9.1.min.js"></script>
		<!--page specific plugin scripts-->

		<script src="__PUBLIC__/js/bootbox.min.js"></script>
		
		<script src="__PUBLIC__/js/bootstrap.min.js"></script>
			
		<!--bbc scripts-->
		<script src="__PUBLIC__/Js/jquery.validate.min.js"></script>
		<!--自定义JS-->
											
                                    
		<script type="text/javascript">
		
		$('form[name="editProductHandle"]').validate({
					//默认为lable
					errorElement : 'span',
					//失败时先移除成功的class
					validClass : 'success',
					//指定成功的样式
					success : function(span){
						span.addClass('success');
					},

					rules:{
						title:{required : true},
						tid:{min : 1},
						price:{required : true},
						stock:{required : true,min : 1},
						gonglv:{required : true},
						yszq:{required : true},
						shouyi:{required : true},
						xiangou:{required : true,min : 1},
						content:{required : true}
					},
					messages:{
						title:{required:'商品名称不能为空'},
                        tid:{min:'请选择商品分类'},	
                        price:{required:'商品价格不能为空'},
						stock:{required:'库存不能为空',min:'库存不能小于等于0'},
						gonglv:{required:'请填写算力值'},	
						yszq:{required:'请填写运行周期'},	
						shouyi:{required:'请填写收益'},
						xiangou:{required:'请填写限购数量'},	
                        content:{required:'商品详情不能为空'}				
					}

				});
		</script>
		<script src="__PUBLIC__/js/bbc-elements.min.js"></script>
		<script src="__PUBLIC__/js/bbc.min.js"></script>
		<script>
			var editor;
			KindEditor.ready(function(K) {
				editor = K.create('textarea[name="content"]', {
					allowFileManager : true
				});
			});
		</script>
	</body>
</html>